package com.mslinn.utils {
    import flash.filesystem.File;
    import flash.filesystem.FileStream;
    import flash.filesystem.FileMode;
    
    public dynamic class Properties {
        public function Properties(file:File) {
            var strProps:String;
            var fileStream:FileStream = new FileStream ();
            if (!file.exists)
                return;
                
            try {        
                fileStream.open(file, FileMode.READ);
                strProps = fileStream.readUTFBytes(file.size);                
            } catch (error:Error) {
                trace(error);
            }
            fileStream.close();
            
            var propArray:Array = strProps.split("\n");
            for (var prop:String in propArray) {
                var nameValue:Array = propArray[prop].split("=");
                var name:String = nameValue[0];
                var value:String = nameValue[1];
                this[name] = value;
            }
        }
    }
}